﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace GameBase.Form.Control
{
    public class MyLabel : MyControl
    {
        int labelHeight;
        public MyLabel(Vector2 position, string text,Color color)
        {
            bound = new Rectangle(0, 0, 0, 50);
            labelHeight = 50;
            Position = position;
            Text = text;
            foreColor = color;
            textAlign = Align.Left;
        }
        public MyLabel(Vector2 position,string text,int height)
        {
            labelHeight = height;
            bound = new Rectangle(0, 0, 0, height);
            Position = position;
            Text = text;
            textAlign = Align.Left;
        }
        protected override void UpdateBound()
        {
            bound.X  = (int)(position.X*screenScale.X+basePosition.X);
            bound.Y = (int)((position.Y ) * screenScale.Y + basePosition.Y);
            bound.Height = (int)(labelHeight * screenScale.Y);
        }
        /*public override void Draw(GameTime gameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            base.Draw(gameTime, spriteBatch);
            string[] strs = text.Split('\n');
            float h = (font.MeasureString("g")).Y;
            Vector2 pos = GetTextPosition();
            foreach (string str in strs)
            {
                spriteBatch.DrawString(font, str, pos, foreColor,
                        0, Vector2.Zero, 1, SpriteEffects.None, depth);
                pos.Y += h;
            }
        }*/
    }
}
